package com.oo.polymorphic_4.drink;

import java.util.Scanner;

/**
 * Cola--${description}
 *
 * @author: Jovi
 * @createTime: 2017-05-09 15:48
 **/
public class Cola extends Drink{

    public Cola() {
        super("可乐");
    }

    @Override
    protected void buy() {
        String msg = "";
        System.out.println("请问喝哪种品牌：（1.可口可乐，2.百事可乐）");
        Scanner sc = new Scanner(System.in);
        int id = sc.nextInt();
        switch (id) {
            case 1:
                msg += "可口可乐";
                break;
            default:
                msg += "百事可乐";
        }
        System.out.println("名称："+this.getName()+"\n品牌："+msg+"\n容量："
        +this.getCapacity());
    }
}
